﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript" type="text/javascript" src="{res file=js/jquery-1.2.6.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=js/common.js}"></script>
<script language="JavaScript" type="text/javascript" src="{res file=js/lan.js}"></script>
<script language="javascript" type="text/javascript" src="{res file=DatePicker/WdatePicker.js}"></script>
<link href="template/style/css/style.css" type="text/css" rel="stylesheet" />
<script language="javascript" type="text/javascript">
$(function() {
$('th[type="order"]').click(function() {
var order = $(this).attr('field') + '-' + $(this).attr('order');
$('#order').val(order);
$('input[name="search"]').click();
}).css({'cursor': 'pointer', 'color': '#36c'});
var order = $('#order').val().split('-');
var field = $('th[type="order"][field="' + order[0] + '"]');
if (order[1] == 'ASC') {
field.attr('order', 'DESC').text(field.text() + '↑');
} else {
field.attr('order', 'ASC').text(field.text() + '↓');
}
if (order[0] != 'arrival_date') {
$('th[type="order"][field="arrival_date"]').attr('order', 'DESC');
}});
</script>
<script type="text/javascript">
$(function(){
	$('#print_reconlist').click(function(){
		var param= new Array();
		var release_date_start="{$release_date_start}";
		var release_date_end="{$release_date_end}";
		var order_sn="{$smarty.get.order_sn}";
		var style_sn="{$smarty.get.style_sn}";
		var brand_id="{$smarty.get.brand_id}";
		var factory_id="{$smarty.get.factory_id}";
		var status="{$smarty.get.status}";
		param.push("release_date_start="+release_date_start,"release_date_end="+release_date_end,"order_sn="+order_sn,"style_sn="+style_sn,"brand_id="+brand_id,"factory_id="+factory_id,"status="+status);
		var url="index.php?app=order&act=reconlist_print&"+param.join('&');
		window.open(url);
	});
});
</script>
</head>
<body>
<div class="sub-body">
	<div id="head">
		<form action="index.php" method="get">
			<table width="80%" cellspacing="0" cellpadding="0" class="search">
				<tbody>
					<tr>
                       <th width="120">工厂入仓日期：</th>
						<td width="200"><input type="text" class="input-6" name="release_date" id="release_date"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"/>
							至
							<input type="text" class="input-6" name="release_date2" id="release_date2"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})"/></td>
                            
						<th width="110">订&nbsp;单&nbsp;号：</th>
						<td width="200"><input type="text" id="order_sn" name="order_sn" class="input-1" /></td>
						<th width="100">款&nbsp;&nbsp;&nbsp;&nbsp;号：</th>
						<td width="200"><input type="text" id="style_sn" name="style_sn" class="input-1" /></td>
						<td width="100" rowspan="3"><input type="hidden" value="reconlist" name="act"/>
							<input type="hidden" value="order" name="app" />
							<input type="hidden" name="order" id="order" value="{if $smarty.get.order}{$smarty.get.order}{else}order_create_date-DESC{/if}" />
							<input type="submit" value="查询" class="inquiry"  name="search" id="print_search" /></td>
					</tr>
					<tr>
						
						<th>品&nbsp;&nbsp;&nbsp;&nbsp;牌：</th>
						<td><select name="brand_id" id="brand_id" onChange="brand_change(this.value);">
								<option value="0"></option>
								<!--{foreach from=$brand_list item=brand key=k}-->
								<option value="{$brand.brand_id}">{$brand.brand_name}&nbsp;&nbsp;({$brand.company_name|escape})</option>
								<!--{/foreach}-->
							</select></td>
						<th>工&nbsp;&nbsp;&nbsp;&nbsp;厂：</th>
						<td><select name="factory_id" id="factory_id">
								
{if $user.is_factory eq 1}

								<option value="{$user.factory_id}">{$user.factory_name}</option>
								

{else}

								<option value="0"></option>
								<!--{foreach from=$factory_list item=factory}-->
								<option value="{$factory.factory_id}">{$factory.factory_name}</option>
								<!--{/foreach}-->
{/if}

							</select></td>
						<th>订单状态：</th>
						<td><select name="status" id="status">
								<option value="-1">全部</option>
								<!--{foreach from=$lang.order_status item=os key=k}-->
								<option value="{$k}">{$os}</option>
								<!--{/foreach}-->
							</select></td>
					</tr>

				</tbody>
			</table>
		</form>
		<script>
<!--{if $role==USER_MERCHANDISER}-->
//$('#brand_id').attr('disabled','true');
$('#merchandiser_id option:first-child').remove();
$('#merchandiser_id').val('{$user.user_id}');
$('#merchandiser_id').attr('readonly','readonly');
<!--{/if}-->
</script> 
	</div>
	<div class="tab_info">
		<div style="padding-bottom: 6px;"><input class="inquiry" value="打印报表" type="button" id="print_reconlist" /></div>
		<div class="tab-title-1"><span>订单列表</span></div>
		<table cellspacing="0" cellpadding="0" id="tab-color1" class="tab-display">
			<tbody>
				<tr>
					<th width="2%"><input type="checkbox" class="checkall" /></th>
					<th width="3%">序号</th>
					<th width="7%" type="order" field="factory_name" order="ASC">工厂</th>
					<th width="7%" type="order" field="release_date" order="ASC">工厂入仓日期</th>
					<th width="6%">订单号</th>
					<th width="5%">款号</th>
					<th width="7%" type="order" field="brand_name" order="ASC">品牌</th>
					<th width="5%" type="order" field="merchandiser" order="ASC">跟单</th>
					<th width="5%">工厂价格</th>
					<th width="5%">客人价格</th>
					<th width="7%">客人应付金额</th>
					<th width="7%">实际出货件数</th>
                    <th width="5%">办公费用</th>
                    <th width="6%">总办公费用</th>
                    <th width="5%" type="order" field="goods_discount" order="ASC">折扣金额</th>
                    <th width="7%">实际支付金额</th>
                    <th width="6%" type="order" field="status" order="ASC">状态</th>
				</tr>
				<!--{foreach from=$orders item=order name=o}-->
				<tr>
					<td><input type="checkbox" class="checkitem" value="{$order.order_id}" /></td>
					<td>{$smarty.foreach.o.iteration}</td>
					<td>{$order.factory_name}</td>
                    <td>{$order.release_date|date}</td>
					<td><a href="{url app=order&act=view&id=$order.order_id}"  style="color:blue">{$order.order_sn|default:-}</a></td>
					<td>{$order.style_sn}</td>
					<td>{$order.brand_name}</td>
					<td>{$order.merchandiser}</td>
					<td>{$order.factory_price}</td>
					<td>{$order.customer_price}</td>
					<td>{$order.custome_price_amount|default:0}</td>
					<td>{$order.ship_count}</td>
                    <td>{$order.work_amount}</td>
					<td>{$order.all_work_amount}</td>
                    <td>{$order.goods_discount}</td>
					<td>{$order.ship_amount}</td>
                    <td>{$lang.order_status.$order.status}</td>
				</tr>
				<!--{/foreach}-->
			</tbody>
		</table>
		<div id="batchAction" style="padding-top: 5px">
		   <input class="btn-2 batchButton" type="button" value="已付款" name="id" uri="index.php?app=order&act=pay_money" presubmit="confirm('您确定要付款已选中的订单吗?');" />&nbsp;&nbsp;
  		</div>
  		<div class="page"> {include file=page.html} </div>
	</div>
</div>
<script language="JavaScript" type="text/javascript" src="{res file=js/tab_color.js}"></script> 
<script language="JavaScript">
$(function(){
//$('table.tab-add  tr:nth-child(odd)').css('backgroundColor',"#f4f8fa");
});
<!--{if $search}-->
$(function(){
var get_para={$get_para};
$.each(get_para,function(k,v){
if($('#'+k)){
$('#'+k).attr('value', v);
}
})
});
<!--{/if}-->
</script>
</body>
{$async_sendmail}
</html>
